package com.gt.contant;

public class DataResult<T> extends CommonAjaxResult {

    private T data;

    public static <T> AjaxResult init(T data) {
        return new DataResult<>(data);
    }

    public static <T> AjaxResult init(T data, AjaxCode code) {
        return new DataResult<>(code, data);
    }

    private DataResult(T data) {
        super(AjaxCode.OK);
        this.data = data;
    }

    private DataResult(AjaxCode code, T data) {
        super(code);
        this.data = data;
    }

    public T getData() {
        return data;
    }
}
